//
//  TableVideoCellNode.swift
//  soapp
//
//  Created by zhu xietong on 2017/8/28.
//  Copyright © 2017年 CocoaPods. All rights reserved.
//

import UIKit
import Eelay
import AsyncDisplayKit
//class TableVideoCellNode:JoCellNode,CellVideoSupport{
//    func stopVideo() {
//        self.player?.removeFromSuperview()
//        self.player?.destroy()
//        self.player = nil
//    }
//    
//    
//    let coverNode = JoImageNode()
//    let playBt = ASButtonNode()
//    
//    weak var player:XLVideoPlayer?
//    {
//        didSet{
//            if let _player = player
//            {
//                _player.frame = coverNode.frame
//                self.view.addSubview(_player)
//            }
//            
//        }
//    }
//
//    open func videoRules() ->[Any]{
//        let imgH = (Swidth-20)*0.5625
//        let rules = coverNode["\(imgH)",_spec(.over(rules: [
//            playBt,_spec(.center(.xy)),"\(60.co)",60.co
//            ]))] as [Any]
//        
//        playBt.placeholderFadeDuration = 3
//        coverNode.url = URL(string:mo.model["article_logo1",""])
//        playBt.imageNode.contentMode = .scaleAspectFit
//        
//        let img = UIImage(named: "ImageResources.bundle/play@3x.png")
//        playBt.setImage(img, for: .normal)
//        playBt.addTarget(self, action: #selector(playAction), forControlEvents: .touchUpInside)
//        return rules
//    }
//    
//    @objc func playAction() {
//        if let listCtr = self.delegate as? ListVideoSupport
//        {
//            listCtr.playVideoWith(videoKit: self, cellModel: self.mo.model, isCell: true)
//        }
//    }
//    
//    open override func cellNodeVisibilityEvent(_ event: ASCellNodeVisibilityEvent, in scrollView: UIScrollView?, withCellFrame cellFrame: CGRect) {
//        if cellFrame == .zero
//        {
//
//            self.player?.removeFromSuperview()
//            self.player?.destroy()
//            self.player = nil
//        }
//    }
//    
//}
//
